package com.pwc.conversionTool.dao;

import static com.pwc.conversionTool.entity.service.OfyService.ofy;

import com.pwc.conversionTool.entity.Task;
import com.pwc.conversionTool.entity.TaskFlow;
import com.pwc.conversionTool.entity.TaskFlowLog;
import com.pwc.conversionTool.entity.TaskLog;


public class LogDao {
	
	public void saveLog(TaskFlowLog log)
	{
		ofy().save().entity(log).now();
	}
	
	
	public void saveLog(TaskLog log)
	{
		ofy().save().entity(log).now();
	}


	public TaskFlowLog getTaskFlowLog(TaskFlow taskFlow) {
		return ofy().load().type(TaskFlowLog.class).filter("taskflowKey",taskFlow.getKey()).first().now();
	}
	
	
	public TaskLog getTaskLogByTask(Task task)
	{
		return ofy().load().type(TaskLog.class).filter("taskKey",task.getKey()).first().now();
	}


	
	

}
